import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import javax.media.opengl.GL2;
import javax.swing.text.html.HTMLDocument.Iterator;


public class Game {
	HashMap<String, IRenderable> models;
	HashMap<String, IShaderResource> shaderResources;
	HashMap<String, Light> lights;
	HashMap<String, Material> materials;
	
	IAudioEngine Audio;
	
	Game()
	{
		Audio = new NoAudio();
	}
	
	public void render()
	{
		gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
		
		java.util.Iterator<Entry<String, IRenderable>> i = models.entrySet().iterator();
		while(i.hasNext())
		{
			Entry<String, IRenderable> entry = i.next();
			IRenderable r = entry.getValue();
			r.render();
		}
	}
	
	public void animate(float t, float dt)
	{
		java.util.Iterator<Entry<String, IRenderable>> i = models.entrySet().iterator();
		while(i.hasNext())
		{
			Entry<String, IRenderable> entry = i.next();
			IRenderable r = entry.getValue();
			r.animate(t, dt);
		}
	}
}
